package com.cdl.interfaces;

import java.io.Serializable;

/**
 * @author cdl
 * @date 2025/10/5
 */
public class Employee implements Comparable<Employee> {

    private String name;
    private double salary;
    public Employee(String name, double salary) {
        this.name = name;
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public void raiseSalary(double byPercent) {
        this.salary = this.salary * byPercent / 100;
    }


    @Override
    public int compareTo(Employee other) {
        return Double.compare(this.salary, other.salary);
    }
}
